package com.xiaoran.rabbitmq.demo.consumer;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WaringConsumer {

    @RabbitListener(queues = "warning_queue")
    public void recive(Message message){
        System.out.println("收到的报警消息是："+new String (message.getBody()));
    }
}
